/*
** ############################################################################
**     Project   : osdee - Operative Systems Design for Embedded Envrionments
**     File      : SchM_Cfg.h
**     Revision  ; 1.0
**     Abstract  :
**         Scheduler Configuration Interface.
**         Definition of the Binary Progressive Scheduler Configuration elements
**
**     Copyright : 2014 Fernando Rodriguez - Victor Huidobro, 
**                 Open source with out any responsability.
**     
**     mail      : frr@gmail.com, vhuidobrog@gmail.com
** ############################################################################
*/

#ifndef _SCHM_CFG_H_
#define _SCHM_CFG_H_

#include "SchM_Types.h"
#include "Gpt_Cfg.h"
#include "SchM_Tasks.h"

/*
** ===================================================================
**     Basic definitios for current
**          Binary Progressive Scheduler. 
** ===================================================================
*/
#define    SCHM_CONFIGURED_TASKS        7  /* Number of configured TASKS */


/*
** ===================================================================
**     Type        :  tsSCHM_Task_Cfg
**
**     Description :
**         Specific Task Configuration.
**         - tId       : Task Id.
**         - tMask     : Assigned Task Mask.
**         - tOffset   : Assigned Task Offset.
**         - tCallback : Task Call back.
**         - tState   : Task status.
** ===================================================================
*/
typedef struct 
{
  teSCHM_Task_Id tId;
  UINT8 tMask;
  UINT8 tOffset;
  tCallbackFunction tCallback;
  teSCHM_Task_State tState;  /* Should be state */
} tsSCHM_Task_Cfg;

/*
** ===================================================================
**     Type        :  tsSCHM_Cfg
**
**     Description :
**         Contains the general Scheduler Configuration.
**         - tOsTick_Cfg : OS TICK configuration through a GPT Channel.
**         - atTasks     : Array of tasks to be scheduled.
** ===================================================================
*/
typedef struct 
{
  tsSCHM_Task_Cfg atTasks[SCHM_CONFIGURED_TASKS];  
}tsSCHM_Cfg;

/*
** ===================================================================
**     Type        :  ser_tSCHM_configuration
**
**     Description :
**         Stores the Scheduler Configuration.
** ===================================================================
*/
extern tsSCHM_Cfg ser_tSCHM_configuration;


#endif /*_SCHM_CFG_H_*/